﻿using System.Collections.Generic;
using Inovout.Business;
using Inovout.Portal.Desktop.Controls;
using Inovout.Portal.Desktop.Workbenchs;

namespace Inovout.Portal.Desktop
{
    internal static class RibbonDescriptor
    {

        internal static List<RibbonTabViewModel> Build(RibbonWorkbenchViewModel workbenchViewModel)
        {
            List<RibbonTabViewModel> tabs = BuildFromXml();
            if (tabs == null)
            {
                tabs = BuildFromFunction(workbenchViewModel);
            }

            return tabs;
        }

        private static List<RibbonTabViewModel> BuildFromFunction(RibbonWorkbenchViewModel workbenchViewModel)
        {
            List<RibbonTabViewModel> tabs = new List<RibbonTabViewModel>();
            foreach (FunctionGroup functionGroup in FunctionGroup.Application.Functions)
            {
                RibbonTabViewModel tab = new RibbonTabViewModel(workbenchViewModel,functionGroup);
                tabs.Add(tab);
            }
            return tabs;
        }

        private static List<RibbonTabViewModel> BuildFromXml()
        {
            return null;
        }
    }
}
